home *** CD-ROM | disk | FTP | other *** search
- Path: Rezonet.net!news
- From: ray@ultimate-tech.com (Ray Dunn)
- Newsgroups: comp.lang.c
- Subject: Re: Is it possible?
- Date: 25 Jan 1996 05:09:35 GMT
- Organization: Ultimate Technographics Inc.
- Message-ID: <4e73af$dvl@ns.RezoNet.NET>
- References: <4e5kuq$9i7@news.ust.hk>
- NNTP-Posting-Host: 204.19.230.7
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.7
-
- In referenced article, Chu Shiu Chung says...
- > If I have declare the following:
- > #define FILENUM 12
- >
- > Is it possible to make the compiler to replace this in printf:
- > printf("FILENUM is the number of files");
- >instead of
- > printf("%d is the number of files", FILENUM);
- >
- >Just like what the compiler do in: int a=FILENUM;
-
- No, because macros are not expanded inside string literals, and
- there's no way you can get the expansion of FILENUM inside string
- quotes, either by using the stringizing operator, or anything else.
-
- Another minus for 'C's preprocessing capabilities.
- --
- Ray Dunn (opinions are my own) | Phone: (514) 938 9050
- Montreal | Phax : (514) 938 5225
- ray@ultimate-tech.com | Home : (514) 630 3749
-
-